<template>
	<view class="bill_details">
		<!-- #ifdef APP-PLUS -->
		<top-set></top-set>
		<tab-top  title="账单明细"></tab-top>
		<!-- #endif -->
		<view class="content">
			<view class="con_head">
				<view class="text1">{{info.handle_name}}</view>
				<view class="text2" space="nbsp" :class="[info.change_type == 'add'?' pr_add':'pr_reduce']">{{info.change_type == 'add'?'+':'-'}} {{info.amount}}</view>
			</view>
			<view class="con_body">
				<view class="text">
					<view class="text_l">交易时间</view>
					<view class="text_r" space="nbsp">{{info.create_time | filDate}}</view>
				</view>
				<view class="text">
					<view class="text_l">交易类型</view>
					<view class="text_r">{{info.handle_name}}</view>
				</view>
				<view class="text">
					<view class="text_l">订单号</view>
					<view class="text_r">{{info.change_sn}}</view>
				</view>
				
			</view>
		</view>
	</view>
</template>

<script>
	let id;
	import moment from "moment";
	export default{
		
		data() {
			return {
				key: '',
				info:''
			}
		},
		filters:{
			filDate(val){
				return moment( val*1000 ).format('YYYY-MM-DD HH:mm');
			}
		},
		methods: {
			async initialization(){
				let res = await this.getData();
				if(res.status == 1) this.info = res.data;
				
			},
			getData(){
				// both/getBalanceShow/150FCB64_9ADD_EAE1_10EC_15B571FD
				return new Promise((res)=>{
					this.req({
						url:"both/getBalanceShow",
						id:id,
						method:"get",
					},(data)=>{
						res(data.data);
					})
				});
			}
		},
		mounted(){
			
		},
		computed:{
			
		},
		onLoad(e){
			console.log(e);
			id = e.id;
		},
		onShow(){
			this.initialization();
		}
		
	}
</script>

<style lang="scss" scoped>
	.bill_details  > .content{
		box-sizing: border-box;
		padding: 0 24upx;
		.con_head:after{
			position: absolute;
			left: 0;
			bottom: 0;
			content: '';
			width: 100%;
			height: 1upx;
			transform: scaleY(0.5);
			background-color: #e5e5e5;
		}
		.con_head{
			height: 120upx;
			line-height: 120upx;
			position: relative;
			.text1{
				color: #333333;
				float: left;
				height: 100%;
				font-size: 28upx;
			}
			.text2{
				float: right;
				height: 100%;
				font-size: 32upx;
			}
			.pr_add{
				color: #3595f9;
			}
			.pr_reduce{
				color: #333333;
			}
		}
		.con_body{
			.text{
				height: 81upx;
				color: #999999;
				line-height: 81upx;
				font-size: 28upx;
				.text_l{
					float: left;
					height: 100%;
				}
				.text_r{
					float: right;
					height: 100%;
				}
			}
		}
	}
</style>
